﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Passwords.ViewModels;
using Passwords.Models;
using Passwords.Utils;
using System.Security.Principal;
using System.Diagnostics;

namespace Passwords
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public static MainWindow Window { get; private set; }

        public MainWindow()
        {
            Window = this;
            App.Settings.SetTheme();
            //DbInitializerUtil.InitializeDb();
            AppViewModel vm = App.ViewModel;
            vm.Settings.Window = this;
            InitializeComponent();
            vm.Settings.LoadSettings(this);
            DataContext = vm;


        }



        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            AppViewModel vm = App.ViewModel;
            vm.Settings.SaveSettings(this);
            base.OnClosing(e);
        }

        private void ThumbButtonInfo_Click(object sender, EventArgs e)
        {
            App.ViewModel.AppDisplayMode = AppDisplayMode.Login;
        }


    }
}
